﻿#include "utils/AsyncManager.h"
#include <common.h>

#include <thread>
#include <utils/ThreadPool.h>

#define TAG "AsyncManager"

AsyncManager* AsyncManager::singleton = nullptr;

AsyncManager::AsyncManager()
{
}

AsyncManager::~AsyncManager()
{
}

bool AsyncManager::asyncLoop()
{
 
    return true;
}

void AsyncManager::SchedulerNext(AsyncManager* singleton)
{
    LogD("enter dev init,idleThreadSize:"<<ThreadPool::getInstance()->getIdleThreadSize());
    //外设资源启动,开始启动外设
    while (singleton->asyncLoop() && ThreadPool::getInstance()->getPoolState());
    LogD("exit dev exit");
}

void AsyncManager::init()
{
}

AsyncManager* AsyncManager::getInstance()
{
    if (AsyncManager::singleton == nullptr) {
        singleton = new AsyncManager();
    }
    return singleton;
}
